try:
    import Tkinter as tk  # Python 2
except ImportError:
    import tkinter as tk  # Python 3

UP, RIGHT, DOWN, LEFT = range(4)

class Circle:
    def __init__(self, canv, x, y, direc, color):
        self.x, self.y = x, y
        self.direction = direc

        self._canvas = canv
        coord = (self.x)-5, (self.y)-5, (self.x)+5, (self.y)+5
        self._index = canv.create_oval(coord, fill=color)

    def move(self):
        y_sign = 1 if self.direction == DOWN else -1
        x_sign = 1 if self.direction == RIGHT else -1
        if self.direction in (UP, DOWN):
            delta = (0, y_sign * 5)
        else:
            delta = (x_sign * 5, 0)
        self._canvas.move(self._index, delta[0], delta[1])


def add_circle(canvas, l):
    d = l[-1].direction
    if d in (UP, DOWN):
        x = l[-1].x
        y = (1 if d == UP else -1) * 10 + l[-1].y
    else:
        x = (1 if d == LEFT else -1) * 10 + l[-1].x
        y = l[-1].y

    circle = Circle(canvas, x, y, d, "green")
    l.append(circle)


def move_circles(circle_l, root):
    for c in circle_l:
        c.move()
    root.after(50, lambda: move_circles(circle_l, root))

root = tk.Tk()
width, height = 750, 450

canvas = tk.Canvas(width=width, height=height, bg="#1C1C1C")
canvas.pack(fill=None, expand=False)

circle_l = []
circle = Circle(canvas, width / 4, height / 4, RIGHT, "gold")
circle_l.append(circle)
for _ in range(5):
    add_circle(canvas, circle_l)

move_circles(circle_l, root)

root.mainloop()